#include "LaneSection.h"

namespace OpenDrive {
	LaneSection::LaneSection(float s, std::string singleSide) :s(s), singleSide(singleSide)	{}

	LaneSection::~LaneSection()	{	}

	Lane& LaneSection::getLaneByLaneId(int laneId)	{
		if (laneId > 0) {
			return _left.getLane(laneId);
		}
		else if (laneId < 0) {
			return _right.getLane(laneId);
		}
		return _center.getLane(0);
	}

	bool LaneSection::laneExist(int laneId) const{
		if (laneId > 0) {
			return _left.laneExist(laneId);
		}
		if (laneId < 0) {
			return _right.laneExist(laneId);
		}
		return false;
	}

	LeftCenterRight& LaneSection::getLeft()	{
		return _left;
	}

	LeftCenterRight& LaneSection::getCenter(){
		return _center;
	}

	LeftCenterRight& LaneSection::getRight(){
		return _right;
	}

	void LaneSection::setLeft(const LeftCenterRight &l){
		_left = l;
	}

	void LaneSection::setCenter(const LeftCenterRight &c){
		_center = c;
	}

	void LaneSection::setRight(const LeftCenterRight &r)
	{
		_right = r;
	}

	void LaneSection::setSingleSide(std::string ss){
		singleSide = ss;
	}

	float LaneSection::getS() const	{
		return s;
	}

	std::string LaneSection::getSingleSide() const{
		return singleSide;
	}
}